<!--
 * @Author: 李小晴 2689279066@qq.com
 * @Date: 2022-06-13 09:11:01
 * @LastEditors: 李小晴 2689279066@qq.com
 * @LastEditTime: 2022-06-14 10:42:00
 * @FilePath: \admin\src\views\Manager\components\Detail.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { PropType } from 'vue'
// import type { TableData } from '@/api/table/types'
import { Descriptions } from '@/components/Descriptions'
import { useI18n } from '@/hooks/web/useI18n'
import { ElTag } from 'element-plus'

const { t } = useI18n()

defineProps({
  currentRow: {
    type: Object as PropType<Nullable<any>>,
    default: () => null
  },
  detailSchema: {
    type: Array as PropType<DescriptionsSchema[]>,
    default: () => []
  }
})
</script>

<template>
  <Descriptions :schema="detailSchema" :data="currentRow || {}">
    <template #is_stop="{ row }: { row: any }">
      <ElTag :type="row.is_stop === '0' ? 'success' : 'warning'">
        {{ row.is_stop === 0 ? t('停用') : t('启用') }}
      </ElTag>
    </template>
  </Descriptions>
</template>
